<html>
<head><meta charset="utf-8"><title>Left arrow token? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html">Left arrow token?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="225466941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Left%20arrow%20token%3F/near/225466941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html#225466941">(Feb 07 2021 at 14:45)</a>:</h4>
<p>The left arrow token (<code>LArrow</code>) is not used, is there a problem with deleting it?</p>



<a name="225467048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Left%20arrow%20token%3F/near/225467048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html#225467048">(Feb 07 2021 at 14:48)</a>:</h4>
<p>I think that might cause this macro to stop working:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="fm">macro_rules!</span><span class="w"> </span><span class="n">m</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="p">(</span><span class="w"> </span><span class="cp">$t</span>:<span class="nc">tt</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{};</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="n">m</span><span class="o">!</span><span class="p">(</span><span class="o">&lt;-</span><span class="p">);</span><span class="w"></span>
</code></pre></div>
<p>...unless <code>tt</code> uses its own rules that treat <code>&lt;-</code> as a single match</p>



<a name="225467059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Left%20arrow%20token%3F/near/225467059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html#225467059">(Feb 07 2021 at 14:49)</a>:</h4>
<p>Hmm, good point.</p>



<a name="225467073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Left%20arrow%20token%3F/near/225467073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html#225467073">(Feb 07 2021 at 14:49)</a>:</h4>
<p>I'm curious, do you know why this token was added?</p>



<a name="225467142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Left%20arrow%20token%3F/near/225467142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html#225467142">(Feb 07 2021 at 14:51)</a>:</h4>
<p>It was used in the placement new syntax, something like <code>place &lt;- value</code></p>



<a name="225467555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Left%20arrow%20token%3F/near/225467555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html#225467555">(Feb 07 2021 at 15:01)</a>:</h4>
<p>Confirmed that removing the token breaks the macro above</p>



<a name="225486353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Left%20arrow%20token%3F/near/225486353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html#225486353">(Feb 07 2021 at 22:01)</a>:</h4>
<p>I think it was originally used to mean "move" instead of copy way back in the early versions of Rust, and then when that use was removed, the token was re-used for what <span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> said.</p>



<a name="225486419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Left%20arrow%20token%3F/near/225486419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html#225486419">(Feb 07 2021 at 22:02)</a>:</h4>
<p>oh, <code>:tt</code> matches glued tokens?</p>



<a name="225486420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Left%20arrow%20token%3F/near/225486420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html#225486420">(Feb 07 2021 at 22:02)</a>:</h4>
<p>that's pretty unfortunate</p>



<a name="225576673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Left%20arrow%20token%3F/near/225576673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Left.20arrow.20token.3F.html#225576673">(Feb 08 2021 at 17:15)</a>:</h4>
<p><code>tt</code> matches an entire token-tree, which can also be a bracketed list of tokens as one, like <code>( anything here )</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>